<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('user_wages', function (Blueprint $table) {
            $table->id();
            $table->unsignedBigInteger('user_id')->default(0)->index();
            $table->unsignedBigInteger('operate_id')->default(0)->comment('操作人');
            $table->decimal('base', 10, 2)->default(0)->comment('社保基数');
            $table->decimal('subsidies', 10, 2)->default(0)->comment('岗位补贴');
            $table->decimal('rewards', 10, 2)->default(0)->comment('研发奖励');
            $table->decimal('other_subsidies', 10, 2)->default(0)->comment('其他补贴');
            $table->decimal('pension_insurance', 10, 2)->default(0)->comment('养老保险8%');
            $table->decimal('medical_insurance', 10, 2)->default(0)->comment('医疗保险2%');
            $table->decimal('unemployment_insurance', 10, 2)->default(0)->comment('失业保险0.5%');
            $table->decimal('housing', 10, 2)->default(0)->comment('住房8%');
            $table->decimal('social_security', 10, 2)->default(0)->comment('个税8%');
            $table->decimal('tax', 10, 2)->default(0)->comment();
            $table->decimal('net_salary', 10, 2)->default(0)->comment('总计（实际支付）');
            $table->string('pay_type')->default('/')->comment('支付方式');
            $table->string('remarks')->default('/');
            $table->string('issue_date');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('user_wages');
    }
};
